<?php

class ContatoController extends TICE_Controlador_Contato {
	
	function init() {
		$this->view->headScript()->appendFile($this->view->baseUrl('_js/jquery.validate/validate.js'));
		$this->view->headScript()->appendFile($this->view->baseUrl('_js/jquery.form.js'));
		$this->view->headScript()->appendFile($this->view->baseUrl('_js/jquery.ajaxPost.js'));
		
		// recupera o email do administrador do arquivo de configuracao
		$bootstrap = $this->getInvokeArg('bootstrap');
    	$config = $bootstrap->getOption('site');
    	$this->paraEmail = $config['emailadministrador'];
    	$this->assunto = 'Contato - bigmix.ind.br';
    	//$this->emailScript = 'contato/email.phtml';
   		if ($this->getRequest()->isXmlHttpRequest()) {
			$this->_helper->layout->disableLayout();
		}
	}
	
    public function enviaAction() {
    	$this->replyTo = $this->_getParam('email');
    	parent::enviaAction();
    }
	protected function resultado($resultado){
		$this->_helper->viewRenderer->setNoRender();
		echo $this->view->json($resultado);
	}
	
}